#!/usr/bin/env python
#    choles_lda_prop
#     ---------------
#    Molecule:         HCN
#    Wave Function:    LDA / aug-cc-pVDZ
#    Test Purpose:     Cholesky LDA energy and properties

import os
import sys

sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from runtest_dalton import Filter, TestRun

test = TestRun(__file__, sys.argv)

f = Filter()
f.add(string = 'Final DFT energy',
      rel_tolerance = 1.0e-8)

f.add(from_string = 'Dipole moment',
      num_lines = 5,
      mask = [1],
      rel_tolerance = 1.0e-5)

f.add(from_string = 'Static polarizabilities (au)',
       num_lines = 9,
       abs_tolerance = 1.0e-5)

# Chemical shielding
f.add(from_string = 'Chemical shielding for ',
      num_lines = 11,
      abs_tolerance = 1.0e-3)

# Magnetizabilities
f.add(from_string = 'Magnetizabilities',
      num_lines = 9,
      mask = [2],
      abs_tolerance = 1.0e-3)

test.run(['choles_lda_prop.dal'], ['HCN_aug-cc-pVDZ.mol'], f={'out': f},
         accepted_errors=['not implemented for parallel calculations.'])

sys.exit(test.return_code)
